package org.eclipse.php.internal.console.ui.view;

import java.text.SimpleDateFormat;
import java.util.Date;

public class HistoryElement {
	public static final SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	
	private String seq;
	private Date date;
	private String shortCommand;
	private String detailedCommand;
	
	public HistoryElement(String seq, Date dte, String sCommand, String dCommand) {
		this.seq = seq;
		this.date = dte;
		this.shortCommand = sCommand;
		this.detailedCommand = dCommand;
	}
	
	public String getDate() {
		return SIMPLE_DATE_FORMAT.format(date);
	}
	
	public String getShortCommand() {
		return shortCommand;
	}
	
	public String getDetailedCommand() {
		return detailedCommand;
	}
	
	public String getSeq() {
		return seq;
	}
	
	public Object[] toArray() {
		Object[] obj = new Object[4];
		obj[0] = seq;
		obj[1] = getDate();
		obj[2] = shortCommand;
		obj[3] = detailedCommand;
		return obj;
	}
}
